#include "SemanticNodeInstanceOf.h"

#include "main2.h"


SemanticNodeInstanceOf::SemanticNodeInstanceOf(const SyntaxTreeNode *instanceOfNode, SemanticNode *parent) : SemanticNode(parent), ValueType(getNextUniqueID()) {
	objectName = flattenNamePeriodAdd(*instanceOfNode->Nodes->GetData(0));
	objectTypeName = flattenNamePeriodAdd(*instanceOfNode->Nodes->GetData(3));
	setType(ValueType::Bool);
}
/**
 *  @fn	std::string SemanticNodeInstanceOf::toDebugString(int tab)
 * 
 *  @brief	.
 * 
 *  @author	Nikola Novak.
 *  @date	6/16/2009.
 * 
 *  @param	tab	.
 * 
 *  @return	.
 */
std::string SemanticNodeInstanceOf::toDebugString(int tab) {
	std::ostringstream str;
	for (int i = 0; i < tab; i++) str << DEBUG_STRING_RAZMAK;
	str << "Is '" << objectName << "' instance of '" << objectTypeName << "'?" << std::endl;
	return str.str();
}
